1. Technical Field
The present invention relates to a detection method of two-dimensional code, a detection device for the same, and a storage medium which stores a detection program for the same, and particularly relates to a method for detecting a two-dimensional code from an image including a two-dimensional code, a device for the same, and a storage medium which stores a program for the same, as well as a detection method for optically readable two-dimensional code and a detection device for the same.
2. Related Art
In recent years, as an optically readable code, a two-dimensional code (two-dimensional barcode) in which coded information is arranged on a matrix to provide a pattern has been in wide spread use.
A barcode which represents data by a combination of vertical lines having different widths and/or spacings is being widely used in the world for such an application as information management of merchandises. The barcode is a 1-dimensional code in which vertical lines are arranged in one direction. Recently, because of the large amount of information which can be represented, utilization of two-dimensional codes has become popularized. The two-dimensional code is a code in which data represented by a binary code is cellularized to be disposed on a two-dimensional matrix as a pattern.
Conventionally, as the above-mentioned two-dimensional code, a two-dimensional code, so-called a QR code, in which, in each of at least two predetermined positions in the matrix, symbols for positioning a pattern, in which a scan line crossing the center thereof at any angle gives the same frequency component ratio is disposed, is proposed.
For example, given contents of a paper document are converted into a two-dimensional code, and in the margin of that paper document, the two-dimensional code may be attached. Thereby, when the paper document is scanned, the attached two-dimensional code can be recognized to be decoded, and the given contents of that paper document can be acquired as electronic data without using an optical character reader (OCR) or the like.
The symbol of the QR code is formed of modules disposed in a square as shown in FIG. 3, and is configured to include an encoding region which is used for encoding of data, and a function pattern, such as a position finder pattern, or the like. The position finder pattern is a function pattern composed of three position detection patterns which are disposed at three corners of the symbol. The center points of the position detection patterns constitute a right angled isosceles triangle, in which the respective center points providing the apices. In addition, around the four sides of the symbol, a margin region called quiet zone is provided.
When the QR code is decoded, a special QR code reader is used to scan the symbol for optically reading it; detect the QR code from the image read; and decode the QR code detected. In order to detect the QR code, the three position detection patterns are detected, and all the coordinates of the center points of those position detection patterns are calculated. With the coordinates of the center points of the position detection patterns being identified, positions of the position finder patterns are determined, and the QR code is detected.
In addition, as the two-dimensional code reading method, a method which involves detecting at least one of code words for two-dimensional code including start and stop code words, thereby determining the orientation of the two-dimensional code symbol in the image data for scanning the two-dimensional code in consideration of the pertinent orientation is proposed.
Although the two-dimensional code as described above can express rather large amount of information as compared with the 1-dimensional code, the amount of information is still restricted. Thus, in case of representing a large amount of information with a QR code, the information is divided into plural QR codes. Conventionally, when the QR codes in this structured append mode are decoded, the symbols are read one by one and the plural QR codes are decoded sequentially.
When reading and decoding plural two-dimensional code which are formed on one document, two methods can be considered: a method of reading, by a special code reader, the two-dimensional codes one by one for decoding them respectively; and a method of reading, by a multi-function machine or the like, the entire one document, and from the obtained image data, detecting plural two-dimensional codes for decoding.